import { PrismaClient } from "@prisma/client"

const prisma = new PrismaClient()

async function main() {
    await prisma.account.upsert({
        where: { tel: '13855556666' },
        update: {},
        create: {
            tel: '13855556666',
            password: 'RJzs4aLD2H3bpaz6HTzr9g==', // 密码对应明文 123456
            status: 1
        }
    })
    await prisma.setting.upsert({
        where: { id: 1 },
        update: {},
        create: {
            notice: '大家好，我的个人博客上线啦～'
        }
    })
}

main()
    .then(async () => {
        await prisma.$disconnect()
    })
    .catch(async (e) => {
        console.error(e)
        await prisma.$disconnect()
        process.exit(1)
    })